<?php
/* @var $this CustomerController */
/* @var $model Customer */

$this->breadcrumbs=array(
	'Customers'=>array('index'),
	'Create',
);

$this->menu=array(
	array('label'=>'List Customer', 'url'=>array('index')),
	array('label'=>'Manage Customer', 'url'=>array('admin')),
);
?>

<?php
$cs = Yii::app ()->clientScript;
$cs->registerScript('#yw2',
"
		$(document).ready(function(){
 		   $('#main-nav .nav-top-item').eq(0).removeClass('current');
		   $('#yw0').css(\"display\",\"none\");
		   $('#yw1').css(\"display\",\"block\");
		   $('#main-nav .nav-top-item').eq(1).addClass('current');
		  $('#yw1 li').eq(1).addClass('current');
		});
"
);
?>

    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>管理客户分组</h3>
        <ul class="content-box-tabs">
          <li><a href="<?php echo $this->createUrl('/backend/customer')?>" >客户列表</a></li>
          <li><a class="default-tab current" href="<?php echo $this->createUrl('/backend/addcustomer')?>">增加客户</a></li>
        </ul>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content" id="tab1">   
			
 		</div>
        <!-- End #tab1 -->
        <div class="tab-content  default-tab" id="tab2">         
            <fieldset>
			<?php $form=$this->beginWidget('CActiveForm', array(
			'id'=>'customer-form',
			'enableAjaxValidation'=>false,
		)); ?>
		
			<p class="note">Fields with <span class="required">*</span> are required.</p>
		
			<?php echo $form->errorSummary($model); ?>
		
			<div class="row">
				<?php echo $form->labelEx($model,'customer_login'); ?>
				<?php echo $form->textField($model,'customer_login',array('class' => 'text-input small-input')); ?>
				<?php echo $form->error($model,'customer_login'); ?>
			</div>
			
			<div class="row">
				<?php echo $form->labelEx($model,'display_name'); ?>
				<?php echo $form->textField($model,'display_name',array('class' => 'text-input small-input')); ?>
				<?php echo $form->error($model,'display_name'); ?>
			</div>
		
			<div class="row">
				<?php echo $form->labelEx($model,'customer_pass'); ?>
				<?php echo $form->textField($model,'customer_pass',array('class' => 'text-input small-input')); ?>
				<?php echo $form->error($model,'customer_pass'); ?>
			</div>
		
			<div class="row">
				<?php echo $form->labelEx($model,'customer_email'); ?>
				<?php echo $form->textField($model,'customer_email',array('class' => 'text-input small-input')); ?>
				<?php echo $form->error($model,'customer_email'); ?>
			</div>

			
			<?php echo $form->hiddenField($model,'customer_url',array('type'=>"hidden" , 'value'=>'' )); ?>
			<?php echo $form->error($model,'customer_url'); ?>
		
			<?php echo $form->hiddenField($model,'customer_registered',array('type'=>"hidden" , 'value'=>date("Y-m-d H:i:s",time()) )); ?>
			<?php echo $form->error($model,'customer_registered'); ?>
		
			<div class="row">
				<?php echo $form->labelEx($model,'customer_group'); ?>
				<?php 
				$list = CHtml::listData(Customergroup::model()->findAll(array('order' => 'ID')), 'ID', 'display_name');				
				echo $form->dropDownList($model,'customer_group',$list);		
				
				?>
				<?php echo $form->error($model,'customer_group'); ?>
			</div>
		
			
			
			<div class="row">
				<?php echo $form->labelEx($model,'用户状态'); ?>
				<?php
					//$list = CHtml::listData(Categories::model()->findAll(array('order' => 'id')), 'id', 'published');
					$list = array( "1"=> "开启", "0" => "禁用");		
					echo $form->dropDownList($model,'customer_status',$list);
				?>
				<?php echo $form->error($model,'customer_status'); ?>
			</div>
		
			
		
			<div class="row buttons">
				<?php echo CHtml::submitButton('增加'); ?>
			</div>

			<?php $this->endWidget(); ?>
		
			
            </fieldset>
            <div class="clear"></div>
            <!-- End .clear -->          
        </div>
        <!-- End #tab2 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
